public class Triangle extends Shape
{
    public Triangle(){
        this.type="三角形";
    }
    protected double firstEdge =30;
    protected double secondEdge =40;
    protected double thirdEdge=50;
    public void calculate()
    {
        // 在这⾥计算三⻆形的⾯积，并将⾯积存储到 area 变量中 ( area 是从⽗类继承的、可⻅的实例变量 )
        double p=(firstEdge+secondEdge+thirdEdge)/2;
        area= Math.sqrt(p*(p-firstEdge)*(p-secondEdge)*(p-thirdEdge));
    }
    public void description()
    {
        // 在这⾥输出三⻆形基本信息(⽐如三边的⻓度)
        // 最后通过调⽤从⽗类继承的、可⻅的 show ⽅法输出 三⻆形的⾯积
    System.out.println(type+"的三条边分别为："+firstEdge+","+secondEdge+","+thirdEdge);
    show();

    }

}
